<!DOCTYPE html>
<html>
<head>
<title>work_db</title>
	<#include "/sys/header.html"/>
	<#include "/sys/header-easyui.html"/>
</head>
<body>
<div class="panel panel-default" id="rrapp" v-cloak>
	<div class="panel-heading">{{title}}</div>
	<form class="form-horizontal">
		<div class="form-group">
			<div class="col-sm-2 control-label">数据源唯一标识</div>
			<div class="col-sm-10">
				<input type="text" class="form-control" v-model="workDb.dbKey" placeholder="数据源唯一标识" required="required"/>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-2 control-label">名称</div>
			<div class="col-sm-10">
				<input type="text" class="form-control" v-model="workDb.name" placeholder="名称"/>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-2 control-label">数据库类型</div>
			<div class="col-sm-10">
				<select  class="form-control" v-model="workDb.dbType" placeholder="数据库类型" @change="changeDbType">
					<template v-for="option in dbTypes">
						<option :value="option.dictCode" v-if="option.dictCode == workDb.dbType" selected>
							{{ option.dictName }}
						</option>
						<option :value="option.dictCode" v-else>
							{{ option.dictName }}
						</option>
					</template>
				</select>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-2 control-label">驱动类</div>
			<div class="col-sm-10">
				<input type="text" class="form-control" v-model="workDb.driverClass" placeholder="驱动类" readonly/>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-2 control-label">连接池</div>
			<div class="col-sm-10">
				<select  class="form-control" v-model="workDb.poolType" placeholder="连接池" @change="changePoolType">
					<template v-for="poolType in poolTypes">
						<option :value="poolType.dictCode" v-if="poolType.dictCode == workDb.poolType" selected>
							{{ poolType.dictName }}
						</option>
						<option :value="poolType.dictCode" v-else>
							{{ poolType.dictName }}
						</option>
					</template>
				</select>
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-2 control-label">连接池选项</div>
			<div class="col-sm-10">
				<!-- <input type="text" class="form-control"  placeholder="连接池选项(json格式)"/>-->
				<table class="easyui-propertygrid"  id="poolOptions-pg"></table>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-2 control-label">jdbcUrl</div>
			<div class="col-sm-10">
				<input type="text" class="form-control" v-model="workDb.dbUrl" placeholder="jdbcUrl"/>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-2 control-label">数据库</div>
			<div class="col-sm-10">
				<input type="text" class="form-control" v-model="workDb.dbName" placeholder="数据库名称"/>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-2 control-label">用户</div>
			<div class="col-sm-10">
				<input type="text" class="form-control" v-model="workDb.dbUser" placeholder="用户"/>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-2 control-label">密码</div>
			<div class="col-sm-10">
				<input type="password" class="form-control" v-model="workDb.dbPassword" placeholder="密码"/>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-2 control-label"></div>
			<input type="button" class="btn btn-info" @click="testConnection" value="测试"/>
			&nbsp;&nbsp;
			<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
			&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="back" value="返回"/>
		</div>
	</form>
</div>

<script src="${base}/js/work/workDb_add.js?_${.now?string['yyyyMMddhhmmSS']}"></script>
</body>
</html>
